<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Scrollbar Attributes for IupGLControls</title>

<link rel="stylesheet" type="text/css" href="../../style.css">
<style type="text/css">
.style2 {
	color: #FF0000;
}
.style3 {
	color: #008000;
}
.style4 {
	font-size: large;
}
</style>
</head>
<body>

<h2>Scrollbar Attributes for IupGLControls <span class="style4">(since 3.11)</span></h2>
<p>In IupGLControls scrollbars are always enabled and they are always automatically shown or 
hidden accordingly to D* &gt;= *MAX-*MIN.</p>
<h3>Configuration Attributes (<font size="3">non inheritable</font>)</h3>
<p><a href="../attrib/iup_dx.html">DX</a>:
  Size of the thumb in the horizontal 
  scrollbar. Also the horizontal page size. Default: "10".</p>
<p><a href="../attrib/iup_dy.html">DY</a>:
  Size of the thumb in the vertical scrollbar. Also the vertical page size. Default: "10".</p>
<p><a href="../attrib/iup_posx.html">POSX</a>:
  Position of the thumb in the horizontal 
  scrollbar. Default: "0".</p>
<p><a href="../attrib/iup_posy.html">POSY</a>:
  Position of the thumb in the vertical 
  scrollbar. Default: "0".</p>
<p><a href="../attrib/iup_xmin.html">XMIN</a>:
  Minimum value of the horizontal scrollbar. Default: "0".</p>
<p><a href="../attrib/iup_xmax.html">XMAX</a>:
  Maximum value of the horizontal scrollbar. Default: "100".</p>
<p><a href="../attrib/iup_ymin.html">YMIN</a>:
  Minimum value of the vertical scrollbar. Default: "0".</p>
<p><a href="../attrib/iup_ymax.html">YMAX</a>:
  Maximum value of the vertical scrollbar. Default: "100".</p>
<p><b>LINEX</b>: The amount the thumb moves when an horizontal step is 
performed. Default: 1/10th of DX.</p>
<p><b>LINEY</b>: The amount the thumb moves when a vertical step is performed. 
Default: 1/10th of DY.</p>
<h3>Appearance Attributes (<font size="3">non inheritable</font>)</h3>

  <p>
  <strong>SB_BACKCOLOR</strong> (<font SIZE="3">non inheritable</font>): color 
  used as background. Can have an alpha component. Default: &quot;200 225 245&quot;. Used instead of BGCOLOR 
  to avoid inheritance problems.</p>
<p><strong>SB_FORECOLOR</strong> (<font SIZE="3">non inheritable</font>): handler 
and arrow 
color. Can have an alpha component. Default: &quot;110 210 230&quot;. Used instead of 
FGCOLOR to avoid inheritance problems. </p>


  <p><strong>SB_HIGHCOLOR</strong> (<font SIZE="3">non inheritable</font>): handler 
  and arrow color when highlight. Default: 
  &quot;90 190 255&quot;.</p>


  <p><strong>SB_PRESSCOLOR</strong> (<font SIZE="3">non inheritable</font>): 
  handler and arrow color when pressed. Default: 
  &quot;50 150 255&quot;.</p>
<p><strong>SCROLLBARSIZE</strong> (<font SIZE="3">non inheritable</font>): The width of the vertical scrollbar or the 
height of the horizontal scrollbar. Default: 11.</p>
<h3>Notes</h3>
<p>The 
  scrollbar allows you to create a virtual space associated to the element. In 
  the image below, such space is marked in <span class="style2"><strong>red</strong></span>, 
  as well as the attributes that affect the composition of this space. In 
<span class="style3"><strong>green</strong></span> you can see how these attributes are 
  reflected on the scrollbar.</p>
<p align="center">
<img src="../attrib/images/scrollbar.gif" alt="../attrib/images/scrollbar.gif (2113 bytes)" border="2" hspace="2" vspace="2"></p>
<p>Hence you can clearly deduce that POSX is limited to XMIN and
  XMAX-DX, or&nbsp; <strong>XMIN&lt;=POSX&lt;=XMAX-DX</strong>. </p>
<p>
<span class="style2"><strong>IMPORTANT:</strong></span> set XMAX to the integer size of the 
virtual space, NOT to &quot;width-1&quot;, or the last pixel of the virtual space will 
never be visible. If you decide to let XMAX with the default value of 100 
and to control only DX, then use the formula DX=visible_width/width.</p>
<p>
When the virtual space has the same size as the canvas, DX equals XMAX-XMIN, the 
scrollbar is automatically hidden. The width 
of the vertical scrollbar (the same as the height of the horizontal scrollbar) 
can be obtained using the SCROLLBARSIZE attribute.</p>
<p>
The same is valid for YMIN, YMAX, DY and POSY. But remember that the Y axis is 
oriented from top to bottom in IUP. So if you want to consider YMIN and YMAX as 
bottom-up oriented, then the actual YPOS must be obtained using <strong>
YMAX-DY-POSY</strong>.</p>
<p>
If you have to change the properties of the scrollbar (XMIN, XMAX and DX) but 
you want to keep the thumb still (if possible) in the same relative position, 
then you have to also recalculate its position (POSX) using the old position as 
reference to the new one. For example, you can convert it to a 0-1 interval and 
then scale to the new limits:</p>
<pre>old_posx_relative = (old_posx - old_xmin)/(old_xmax - old_xmin)
posx = (xmax - xmin)*old_posx_relative + xmin</pre>
<h3>Affects</h3>
<p><a href="iupglscrollbox.html">IupGLScrollBox</a></p>
<h3>See Also</h3>
<p><a href="iup_posx.html">POSX</a>,
<a href="iup_xmin.html">XMIN</a>, <a href="iup_xmax.html">XMAX</a>,
<a href="iup_dx.html">DX</a>, <a href="iup_posy.html">POSY</a>,
<a href="iup_ymin.html">YMIN</a>, <a href="iup_ymax.html">YMAX</a>,
<a href="iup_dy.html">DY</a></p>

</body>

</html>